// source --> https://iralia.com.au/wp-content/plugins/wp-e-commerce/wpsc-core/js/wp-e-commerce.js?ver=3.14.0.855a4af6 /* globals jQuery */ /////////////////////////////////////////////////////////////////////////////////////////////// // This section is used to create the globals that were originally defined in the // dynamic-js file pre 3.8.14. Note that variables also also exist in the "wpsc_ajax" structure. // To add a new global property that can be referenced in the script see the hook // wpsc_javascript_localizations in wpsc-core/wpsc-functions.php // /** * javascript variables for WP-e-Commerce * * These WPeC WordPress localized variables were in use prior to release 3.8.14, and are explicitly * declared here for maximum backwards compatibility. * * In releases prior to 3.8.14 these legacy variables may have been declared in the dynamically * created javascript, or in the HTML as a localized variable. * * For javascript variables added after version 3.8.14 use the following utility function to access the * localized variables. * * wpsc_var_get ( name ) * wpsc_var_set ( name, value ) * wpsc_var_isset ( name, value ); * */ if ( typeof wpsc_vars !== 'undefined' ) { var wpsc_ajax = wpsc_vars.wpsc_ajax; var base_url = wpsc_vars.base_url; var WPSC_URL = wpsc_vars.WPSC_URL; var WPSC_IMAGE_URL = wpsc_vars.WPSC_IMAGE_URL; var WPSC_IMAGE_URL = wpsc_vars.WPSC_IMAGE_URL; var WPSC_CORE_IMAGES_URL = wpsc_vars.WPSC_CORE_IMAGES_URL; var fileThickboxLoadingImage = wpsc_vars.fileThickboxLoadingImage; } // end of variable definitions /////////////////////////////////////////////////////////////////////////////////////////////// /** * check if a localized WPeC value is set * * @since 3.8.14 * * @param string name name of localized variable * * @returns boolean true if the variable is set, false otherwise * */ function wpsc_var_isset( name ) { if ( typeof wpsc_vars !== 'undefined' ) { return wpsc_vars[name] !== undefined; } return false; } /** * get the value of a localized WPeC value if it is set * * @since 3.8.14 * * @param string name name of localized variable * * @returns varies value of the var set * */ function wpsc_var_get( name ) { if ( typeof wpsc_vars !== 'undefined' ) { return wpsc_vars[name]; } return undefined; } /** * Checks to determine whether or not an element is fully visible * * @since 3.8.14.1 * @param jQuery object el Element being checked for visibility. * @return boolean Whether or not element is visible. */ function wpsc_element_is_visible( el ) { var top = jQuery( window ).scrollTop(), bottom = top + jQuery( window ).height(), elTop = el.offset().top; return ( (elTop >= top ) && ( elTop <= bottom ) && ( elTop <= bottom ) && ( elTop >= top ) ) && el.is( ':visible' ); } /** * change the value of a localized WPeC var * * @since 3.8.14 * * @param string name name of localized variable * @param varies value value of the var being set * * @returns varies value of the var being set * */ function wpsc_var_set( name, value ) { if ( typeof wpsc_vars !== 'undefined' ) { wpsc_vars[name] = value; return value; } return undefined; } /** * Create an tags. * @param {string|int|float} [value=''] The value's option, (for the "value" attribute). * * @returns {*} A jQuerified